import { listNodeOption } from '@/pages/Node/api';
import { ProFormDigit, ProFormGroup, ProFormSelect, ProFormText } from '@ant-design/pro-form';

export const formChildren = () => {
  return (
    <>
      <ProFormText
        name='name'
        label='名称'
        rules={[
          { required: true, message: '请填写名称' },
        ]}
      />
      <ProFormSelect
        name='allow_nodes'
        label='节点'
        rules={[
          { required: true, message: '请选择节点' },
        ]}
        mode={'multiple'}
        request={listNodeOption}
      />
      <ProFormGroup>
        <ProFormDigit
          label='最大CPU(核)'
          name='max_cpu'
          width='sm'
          min={1}
          dataFormat='string'
          rules={[
            { required: true, message: '请填入最大CPU' },
          ]}
        />

        <ProFormDigit
          label='最大内存(G)'
          name='max_memory'
          width='sm' 
          min={1}
          rules={[
            { required: true, message: '请填入最大内存' },
          ]}
        />

        <ProFormDigit
          label='最大硬盘(G)'
          name='max_disk'
          width='sm'
          min={1}
          rules={[
            { required: true, message: '请填入最大硬盘' },
          ]}
        />
      </ProFormGroup>
    </>
  );
};
